-
Notifications
You must be signed in to change notification settings - Fork 2.5k
base-images: add honggfuzz dependencies #14315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We need libunwind-dev libblocksruntime-dev for ubuntu 24 to work with honggfuzz. Signed-off-by: David Korczynski <[email protected]>
jonathanmetzman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
| subversion \ | ||
| zip | ||
| zip \ | ||
| libunwind-dev libblocksruntime-dev # needed for Honggfuzz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand base-builder should already be covered in
| PACKAGES=( | |
| libunwind8-dev | |
| libblocksruntime-dev | |
| liblzma-dev | |
| libiberty-dev | |
| zlib1g-dev | |
| pkg-config) | |
| apt-get update && apt-get install -y ${PACKAGES[@]} |
but I have to admit I'm not sure what's going on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think we only need this in the base-runner. Will double check in a few hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the weirdest part is that libBlocksRuntime pops up on Ubuntu-24.04 only:
root@07ccb8ef8f92:/src/avahi# ldd /out/honggfuzz
linux-vdso.so.1 (0x00007fe6f360b000)
libBlocksRuntime.so.0 => not found
libunwind-ptrace.so.0 => not found
libunwind-x86_64.so.8 => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe6f2dea000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe6f360d000)With the old images honggfuzz doesn't seem to be linked dynamically against those things:
root@abd8c6c5024a:/src/elfutils# ldd /out/honggfuzz
linux-vdso.so.1 (0x00007fe5c0d04000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe5c04b1000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe5c0ceb000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe5c0ce5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe5c0cc2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe5c02bf000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe5c0d06000)The only difference seems to be LDFLAGS (with -lBlocksRuntime -lunwind-ptrace -lunwind-generic) passed in
| CC=clang CFLAGS="-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error" make LDFLAGS="-lBlocksRuntime -lunwind-ptrace -lunwind-generic" |
Everything else appears to be identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like with LDFLAGS removed it isn't linked dynamically against BlocksRuntime. BUILD_OSSFUZZ_STATIC=true also causes Makefile to add
-Wl,-Bstatic \
`pkg-config --libs --static libunwind-ptrace libunwind-generic` \
-lopcodes -lbfd -liberty -lz \
-Wl,-Bdynamicso it seems to me the issue can be fixed by removing LDFLAGS. I'm not sure why they were added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out on Ubuntu 24.04 it fails with
ar rcs libhfcommon/libhfcommon.a libhfcommon/files.o libhfcommon/log.o libhfcommon/ns.o libhfcommon/util.o
clang -o honggfuzz cmdline.o display.o fuzz.o honggfuzz.o input.o mangle.o report.o sanitizers.o socketfuzzer.o subproc.o linux/arch.o linux/bfd.o linux/perf.o linux/pt.o linux/trace.o linux/unwind.o libhfcommon/libhfcommon.a -pthread -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lm -L/usr/local/include -Wl,-Bstatic `pkg-config --libs --static libunwind-ptrace libunwind-generic` -lopcodes -lbfd -liberty -lz -Wl,-Bdynamic -lrt -ldl -lm -Wl,-Bstatic -lBlocksRuntime -Wl,-Bdynamic
/usr/bin/ld: /lib/x86_64-linux-gnu/libunwind-ptrace.a(_UPT_access_fpreg.o): relocation R_X86_64_32S against symbol `_UPT_reg_offset' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)so I'm guessing that's where LDFLAGS came from (it's load-bearing apparently :-)). Either way it seems the deps should go to base-runner only.
|
/gcbrun skip |
Signed-off-by: David Korczynski <[email protected]>
in #13964 `--pull` was added to `docker build`. However, this causes issues when developing the images locally, as we always end up pulling upstream images causing issues when building changes that carry through several base images. Removing `--pull` from this. Was running into this when debugging #14315
We need libunwind-dev libblocksruntime-dev for ubuntu 24 to work with honggfuzz.